package buganville

import com.kyub.buganville.Priority
class EnumIconsTagLib {

  def issueType = { attrs ->

    def type = attrs['type']
    out << "<img src=\"/buganville/images/skin/"+type+".gif\" alt=\""+type+"\" />"
    
  }

  def priorityLevel = {attrs ->

     def level = attrs['level']
     def n = 0
     if(level.equals(Priority.HIGH)){
        n = 3
     }
     else if(level.equals(Priority.MEDIUM)){
        n = 2
     } else if(level.equals(Priority.LOW)){
        n = 1
     }
    for(def i= 1; i <=n;i++){
     out << "<img src=\"/buganville/images/skin/arrow_up.gif\" alt=\""+level+"\" />" 
    }

  }

  def issueStrtus = { attrs ->

    def status = attrs['status']
    out << "<img src=\"/buganville/images/skin/"+status+".png\" alt=\""+status+"\" />"

  }

}
